/**
 * @file 公共配置文件
 * @author wanglei48@baidu.com, zhaozhixin@baidu.com
 */

(function () {

    // 项目根路径，这个会跟着外层入口index.html而变化
    var  locationHref   =  location.href;
      locationHref = locationHref.split('?')[0];
     locationHref = locationHref.split('/');
    if(locationHref[locationHref.length-2]  == 'draBoatFest'||locationHref[locationHref.length-2]  == 'paipai'|| locationHref[locationHref.length-2]  == 'fundinfo'|| locationHref[locationHref.length-2]  == 'coupon'||locationHref[locationHref.length-2]  == 'pension'||locationHref[locationHref.length-2]  == 'special'|| locationHref[locationHref.length-2]  == 'guessupdown'|| locationHref[locationHref.length-2]  ==  'agreement' || locationHref[locationHref.length-2]  ==  'cleverInvest' ||  locationHref[locationHref.length-2]  ==  'combinvest'||  locationHref[locationHref.length-2]  ==  'account'||  locationHref[locationHref.length-2]  ==  'wealth'||  locationHref[locationHref.length-2]  ==  'fixincome'){
         var app = '../blade/';
         var project = '../static/index/';
         var  echartPath = '../';
     }else{
         var app = 'blade/';
         var project = 'static/index/';
          var  echartPath = '';
     }
    
    // 模板路径
    require.config({
        urlArgs: "v=20180615",
        paths: {
            //index相关模板根目录

            //'AbstractApp':app+'mvc/abstract.app',

            m_zepto:app + 'libs/zepto.min',//
            m_tpl:app + 'libs/underscore.min',//模板


            'text': app + 'libs/require.text',//处理.html模板文件
            init: project + 'index',

            m_swipe:project+'swiper.min',//swiper 模块
            m_tab:project+'tab',//tab切换模块

            //m_tips:'',//提示模块
            // m_loading:app+'ui/loading',
            m_toast:app+'ui/toast',
            m_basepage:app + 'mvc/base.page',//单页模块


            p_home:app + 'ui/page.home',
            T_UIHomeView: app + 'ui/ui.home.html?v=201806144',//
            
             p_couponUse: app + 'ui/page.couponUse',
            p_funds: app + 'ui/page.funds',
            T_UIFundsView: app + 'ui/ui.funds.html?version=201806144',//全部基金列表
            
            T_UIHotFundsView: app + 'ui/ui.hotFunds.html?v=201806144',//热门基金列表UI
            
            T_UIHotThemFundsView:app + 'ui/ui.hotThemFunds.html?v=20171213',//热门主题基金列表UI
            
            T_UIEstimateFundsView: app + 'ui/ui.estimateFunds.html?v=20171213',//净值估算基金列表
            
             m_hammer:project+'hammer.min',//资产页面 顶部tab切换模板 模块
            T_UIFundSearchView: app + 'ui/ui.funds.search.html?v=20171212',
            

            p_wealth: app + 'ui/page.wealth',
            T_UIWealthView: app + 'ui/ui.wealth.html?v=20180612',

            p_more: app + 'ui/page.more',
            T_UIMoreView:app + 'ui/ui.more.html',

            T_UITabView : app + 'ui/ui.tab.html',

            T_FooterView: app + 'ui/app.footer.html',

            m_selectBox:app + 'ui/selectBox',//选择框js
             m_selectBank:app + 'ui/selectBank',//选择框js
            
            T_UISelectBox:app + 'ui/ui.selectBox.html',//选择框模板
            T_UISelectBank:app + 'ui/ui.selectBank.html?aa=898989',//选择银行模板

            dialog:app + 'ui/dialog',//弹窗会话组件
            T_UIDialog:app+'ui/ui.dialog.html?aa=454545',//弹窗会话模板

            m_selectDate:app + 'ui/selectDate',//选择日期模板
            T_UISelectDate:app + 'ui/ui.selectDate.html',//选择框模板
            
             m_selectPayway:app+'ui/selectPayway',//支付方式js
             T_UISelectPayway:app + 'ui/ui.selectPayway.html',//支付方式模版
             
              m_dateActionSel:app+'ui/dateActionSel',//身份证日期js
              T_UIdateActionSel:app + 'ui/ui.dateActionSel.html',//身份证日期模板
              
               m_actionSel:app+'ui/actionSel',//地址选择js
                T_UIactionSel:app + 'ui/ui.actionSel.html',//地址选择模板
             
            echarts: echartPath+'static/js/echarts',//echart图表模块
            
        },
        shim:{
            m_zepto: {
                exports: '$'
            },
            backbone: {
                deps: ['underscore', 'zepto']
            }
        }});
    //异步加载回掉;
})();